package com.sugon.controller;

import com.sugon.service.VmsaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value="/api")
public class VmsaController {

    @Autowired
    private VmsaService vmsaService;

    @RequestMapping(value="/getVideoUrl",method = RequestMethod.GET)
    @CrossOrigin("*")
    public String getVideoUrl(@RequestParam int cid){
        String token = vmsaService.getVideoToken();
        String url = "http://172.11.16.248:10031/v2/" + cid + "/live.m3u8?client_token=" + token;
        return url;
    }
}
